import Vue from 'vue';
import Router from 'vue-router';
// import Hello from '@/components/Hello';

Vue.use(Router);

export default new Router({
    // mode: 'history',
    routes: [
        {
            path: '/',
            redirect: '/index'
        },
        {
            path: '/login',
            component: resolve => require(['@/components/page/Login.vue'], resolve)
        },
        {
            path: '/home',
            component: resolve => require(['@/components/common_page/Home.vue'], resolve),
            children: [
                {
                    path: '/index',
                    component: resolve => require(['@/components/page/index.vue'], resolve)
                },
                {
                    path: '/category',
                    component: resolve => require(['@/components/page/category.vue'], resolve)
                },
                {
                    path: '/admin',
                    component: resolve => require(['@/components/page/admin.vue'], resolve)
                },
                {
                    path: '/house',
                    component: resolve => require(['@/components/page/house.vue'], resolve)
                },
                {
                    path: '/house/:id(\\d+)',
                    component: resolve => require(['@/components/page/houseedit.vue'], resolve)
                },
                {
                    path: '/house/new',
                    component: resolve => require(['@/components/page/houseedit.vue'], resolve)
                },
                {
                    path: '/menu',
                    component: resolve => require(['@/components/page/menu.vue'], resolve)
                },
                {
                    path: '/menu/:id(\\d+)',
                    component: resolve => require(['@/components/page/menuedit.vue'], resolve)
                },
                {
                    path: '/article',
                    component: resolve => require(['@/components/page/article.vue'], resolve)
                },
                {
                    path: '/article/:id(\\d+)',
                    component: resolve => require(['@/components/page/articleedit.vue'], resolve)
                },
                {
                    path: '/article/new',
                    component: resolve => require(['@/components/page/articleedit.vue'], resolve)
                },
                {
                    path: '/photo',
                    component: resolve => require(['@/components/page/photo.vue'], resolve)
                },
                {
                    path: '/photo/:id(\\d+)',
                    component: resolve => require(['@/components/page/photoedit.vue'], resolve)
                }
            ]
        }
    ]
});
